<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{:t('会员')}编辑</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
	<script src="__STATIC__/admin/js/address3.js"></script>
	<style>
		.alert{
			position: fixed;
			height: 100%;
			width: 100%;
			top: 0;
			left: 0;
			z-index: 5;
			display: none;
			background: rgba(0, 0, 0, 0.7);
		}
		.alert_container{
			position: absolute;
			height: 100%;
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
		}
		.alert_module{
			padding: 15px;
			border-radius: 5px;
			background: #fff;
		}
		.alert_title{
			font-size: 18px;
			color: #303133;
			display: flex;
			align-items: center;
			justify-content: space-between;
		}
		.alert_content{
			width: 650px;
			padding: 15px 0;
			display: flex;
		}
		.alert_area{
			flex: 1;
			height: 400px;
			overflow-y: scroll;
		}
		.alert_item{
			font-size: 14px;
			color: #333;
			padding: 0 15px;
			display: flex;
			cursor: pointer;
			min-width: 0;
			align-items: center;
		}
		.alert_icon{
			height: 18px;
			width: 18px;
			box-sizing: border-box;
			border-radius: 4px;
			border: 1px solid;
			background: #fff;
			border-color: #c9c9c9;
		}
		.alert_active{
			display: flex;
			align-items: center;
			justify-content: center;
			background: #1e9fff;
			border-color: #1e9fff;
		}
		.alert_text{
			flex: 1;
			padding: 10px;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
			min-width: 0;
		}
		.alert_item:hover{
			background: #ebf5ff;
		}
		.alert_close{
			cursor: pointer;
		}
		.alert_close:hover{
			color: #1e9fff;
		}
		.alert_opt{
			position: relative;
			display: flex;
			justify-content: flex-end;
		}
		.alert_opt button{
			margin-left: 10px;
		}
		::-webkit-scrollbar {
			width: 10px;
			height: 10px;
			background-color: #fff;
			border-radius: 5px;
		}
		::-webkit-scrollbar-thumb {
			background-color: silver;
			border-radius: 5px;
		}
		::-webkit-scrollbar-track {
			background-color: #fff;
		}

		.area{
			position: relative;
			display: flex;
		}
		.area_module{
			padding: 5px 10px;
			border-width: 1px;
			border-style: solid;
			border-color: #e6e6e6;
			background-color: #fff;
			border-radius: 2px;
			display: flex;
			align-items: center;
			font-size: 14px;
			cursor: pointer;
		}
		.area_content{
			min-width: 150px;
			display: flex;
			color: #c9c9c9;
			flex-wrap: wrap;
		}
		.area_item{
			padding: 2px 10px;
			background: #009688;
			color: #fff;
			display: flex;
			align-items: center;
			border-radius: 2px;
			font-size: 14px;
			margin: 2.5px;
		}
	</style>
</head>
<body>
<div class="layui-fluid">
	<div class="layui-row layui-col-space15">
		<div class="layui-card layui-col-md12">
			<div class="layui-card-header"><i class="fa fa-edit"></i> {:t('会员')}编辑<i class="layui-icon layui-icon-close" style="font-size:18px;font-weight:bold;cursor:pointer" onclick="closeself()"></i></div>
				<div class="layui-card-body" pad15>
					<div class="layui-form form-label-w6" lay-filter="form">
						<input type="hidden" name="info[id]" value="{$info.id}"/>
						<div class="layui-tab layui-tab-brief" lay-filter="mytab">
							<ul class="layui-tab-title">
								<li class="layui-this" lay-id="1">基本信息</li>
								{if getcustom('register_fields')}<li lay-id="2">扩展信息</li>{/if}
								{if getcustom('member_set')}<li lay-id="2">资料设置</li>{/if}
								{if getcustom('member_richinfo')}<li lay-id="2">详细介绍</li>{/if}
							</ul>
							<div class="layui-tab-content">
								<!--基本信息start-->
								<div class="layui-tab-item layui-show">
									{if $info['mpopenid']}
									<div class="layui-form-item">
										<label class="layui-form-label">公众号openid</label>
										<div class="layui-form-mid">{$info.mpopenid}</div>
									</div>
									{/if}
									{if $info['wxopenid']}
									<div class="layui-form-item">
										<label class="layui-form-label">微信小程序openid</label>
										<div class="layui-form-mid">{$info.wxopenid}</div>
									</div>
									{/if}
									{if getcustom('xixie')}
									<div class="layui-form-item">
										<label class="layui-form-label">门店</label>
										<div class="layui-input-inline">
											<select name="info[mdid]" lay-filter="yxqset" class="levelid">
												<option value="" >无</option>
												{foreach $mendian as $v}
												<option value="{$v.id}" {if $v['id'] == $info['mdid']}selected{/if}>{$v.name}</option>
												{/foreach}
											</select>
										</div>
									</div>
									{/if}
									<div class="layui-form-item">
										<label class="layui-form-label">头像</label>
										<input type="hidden" name="info[headimg]" id="headimg" class="layui-input" value="{$info.headimg}">
										<button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="headimg" upload-preview="headimgPreview" onclick="uploader(this)">上传图片</button>
										<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：150×150像素</div>
										<div id="headimgPreview" class="picsList-class-padding">
											<div class="layui-imgbox" style="width:100px;"><div class="layui-imgbox-img"><img src="{$info.headimg}"/></div></div>
										</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label"><span class="redstar">*</span>昵称</label>
										<div class="layui-input-inline">
											<input type="text" name="info[nickname]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info.nickname}">
										</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">姓名</label>
										<div class="layui-input-inline">
											<input type="text" name="info[realname]" class="layui-input" value="{$info.realname}">
										</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">手机号</label>
										<div class="layui-input-inline">
											<input type="text" name="info[tel]" class="layui-input" value="{$info.tel}">
										</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">身份证号</label>
										<div class="layui-input-inline">
											<input type="text" name="info[usercard]" class="layui-input" value="{$info.usercard}">
										</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">性别</label>
										<div class="layui-input-inline" style="width:700px">
											<input type="radio" name="info[sex]" value="1" lay-filter="areafenhongChange" {if $info['sex']==1}checked{/if} title="男"/>
											<input type="radio" name="info[sex]" value="2" lay-filter="areafenhongChange" {if $info['sex']==2}checked{/if} title="女"/>
											<input type="radio" name="info[sex]" value="0"  {if $info['sex']==0}checked{/if} title="未知"/>
										</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">生日</label>
										<div class="layui-input-inline">
											<input type="text" id="birthday" name="info[birthday]" class="layui-input" value="{$info.birthday}">
										</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">{:t('积分')}</label>
										<div class="layui-input-inline">
											<input type="text" name="info[score]" class="layui-input" value="{$info.score}">
										</div>
									</div>
									<div class="level-box">
										<div class="layui-form-item">
											<label class="layui-form-label">等级</label>
											<div class="layui-input-inline">
												<select name="info[levelid]" lay-verify="required" lay-filter="yxqset" class="levelid">
													{foreach $levelList as $v}
													<option value="{$v.id}" {if $v['id'] == $info['levelid']}selected{/if}>{$v.name}</option>
													{/foreach}
												</select>
											</div>
											<div id="yxqset" {if $defaultlevel['id'] == $info['levelid']}style="display:none"{/if}>
												<div class="layui-form-mid">有效期</div>
												<div class="layui-input-inline" id="levelendtime_div" style="{if $info['levelendtime']==0}display:none{/if}">
													<input type="text" name="info[levelendtime]" id="levelendtime" autocomplete="off" class="layui-input" value="{$info['levelendtime'] > 0 ? date('Y-m-d',$info['levelendtime']) : ''}">
												</div>
												<div class="layui-input-inline">
													<input type="checkbox" name="levelcq" value="1" {if $info['levelendtime']==0}checked{/if} title="长期" lay-filter="levelcq"/>
												</div>
											</div>
										</div>
										<div class="layui-form-item">
											<label class="layui-form-label">区域代理</label>
											<div class="layui-input-inline" style="width:700px">
												<input type="radio" name="info[areafenhong]" value="0" lay-filter="areafenhongChange" {if $info['areafenhong']==0}checked{/if} title="跟随会员等级设置"/>
												{if getcustom('areafenhong_jiaquan') && ($auth_data=='all' || in_array('Largearea/*',$auth_data))}
												<input type="radio" name="info[areafenhong]" value="10" lay-filter="areafenhongChange" {if $info['areafenhong']==10}checked{/if} title="大区代理"/>
												{/if}
												<input type="radio" name="info[areafenhong]" value="1" lay-filter="areafenhongChange" {if $info['areafenhong']==1}checked{/if} title="省级代理"/>
												<input type="radio" name="info[areafenhong]" value="2" lay-filter="areafenhongChange" {if $info['areafenhong']==2}checked{/if} title="市级代理"/>
												<input type="radio" name="info[areafenhong]" value="3" lay-filter="areafenhongChange" {if $info['areafenhong']==3}checked{/if} title="区县代理"/>
												<input type="radio" name="info[areafenhong]" value="4" lay-filter="areafenhongChange" {if $info['areafenhong']==4}checked{/if} title="非区域代理"/>
											</div>
										</div>
										<div class="layui-form-item areafenhong_address" {if ($info['areafenhong']==0 && $levelArr[$info['levelid']]['areafenhong']==0) || $info['areafenhong']==4}style="display:none"{/if}>
											<label class="layui-form-label">代理区域</label>
											{if getcustom('areafenhong_jiaquan') && ($auth_data=='all' || in_array('Largearea/*',$auth_data))}
											<div class="layui-input-inline areafenhong_largearea_div" {if ($info['areafenhong']==0 && $levelArr[$info['levelid']]['areafenhong']!=10) || in_array($info['areafenhong'],[1,2,3])}style="display:none"{/if}>
												<select name="info[areafenhong_largearea]" id="areafenhong_largearea">
													<option value="">请选择大区</option>
													{php} $largearealist = db('largearea')->where('aid',$aid)->where('status',1)->order('sort desc,id')->column('name');{/php}
													{foreach $largearealist as $largearea}
													<option value="{$largearea}" {if $info['areafenhong_largearea'] == $largearea}selected{/if}>{$largearea}</option>
													{/foreach}
												</select>
											</div>
											{/if}
											<div class="layui-input-inline areafenhong_province_div" {if ($info['areafenhong']==0 && !in_array($levelArr[$info['levelid']]['areafenhong'],[1,2,3])) || $info['areafenhong']==10}style="display:none"{/if}>
												<select name="info[areafenhong_province]" id="areafenhong_province" lay-filter="areafenhong_province"></select>
											</div>
											<div class="layui-input-inline areafenhong_city_div" {if ($info['areafenhong']==0 && !in_array($levelArr[$info['levelid']]['areafenhong'],[2,3])) || in_array($info['areafenhong'],[1,10])}style="display:none"{/if}>
												<select name="info[areafenhong_city]" id="areafenhong_city" lay-filter="areafenhong_city"></select>
											</div>
											<div class="layui-input-inline areafenhong_area_div" {if ($info['areafenhong']==0 && $levelArr[$info['levelid']]['areafenhong']!=3) || in_array($info['areafenhong'],[1,2,10])}style="display:none"{/if}>
												<select name="info[areafenhong_area]" id="areafenhong_area"></select>
											</div>
										</div>
										{if getcustom('member_area_agent_multi')}
										<div class="layui-form-item">
											<label class="layui-form-label">代理区域</label>
											<div class="layui-input-inline" style="width:700px">
												<div class="area">
													<div class="area_module">
														<div class="area_content"></div>
														<i class="layui-icon layui-icon-triangle-d" style="margin-left:5px;color: #c0c0c0;"></i> 
													</div>
												</div>
											</div>
										</div>
										<div class="alert">
											<div class="alert_container">
												<div class="alert_module">
													<div class="alert_title">
														<span>请选择区域代理</span>
														<i class="layui-icon layui-icon-close alert_close alert_hide"></i>
													</div>
													<div class="alert_content">
														<div class="alert_area select_province"></div>
														<div class="alert_area select_city"></div>
														<div class="alert_area select_area"></div>
													</div>
													<div class="alert_opt">
														<button type="button" class="layui-btn layui-btn-primary alert_hide">取消</button>
														<button type="button" class="layui-btn layui-btn-normal alert_hide">确定</button>
													</div>
												</div>
											</div>
										</div>
										{/if}
										<div class="layui-form-item areafenhong_bili" {if !in_array($info['areafenhong'],[1,2,3])}style="display:none"{/if}>
											<label class="layui-form-label">分红比例</label>
											<div class="layui-input-inline">
												<input type="text" name="info[areafenhongbl]" class="layui-input" value="{$info.areafenhongbl}">
											</div>
											<div class="layui-form-mid">%</div>
											<div class="layui-form-mid layui-word-aux">区域代理的分红比例</div>
										</div>
										{if getcustom('maidan_fenhong_new')}
										<div class="layui-form-item areafenhong_bili" {if !in_array($info['areafenhong'],[1,2,3])}style="display:none"{/if}>
											<label class="layui-form-label">买单分红比例</label>
											<div class="layui-input-inline">
												<input type="text" name="info[areafenhongbl_maidan]" class="layui-input" value="{$info.areafenhongbl_maidan}">
											</div>
											<div class="layui-form-mid">%</div>
											<div class="layui-form-mid layui-word-aux">区域代理的分红比例</div>
										</div>
										{/if}
									</div>
									{if getcustom('plug_sanyang')}
									<style>
										.level-box { border-bottom: 1px solid #ddd; margin: 10px 0; width: 1000px;}
									</style>
									{if $levelExtendList}
									{foreach $levelExtendList as $levelExtend}
									<div class="level-box">
										<div class="layui-form-item">
											<label class="layui-form-label">扩展等级</label>
											<div class="layui-input-inline">
												<select name="record[levelid]" class="levelid" lay-verify="required">
													<option value="0">请选择</option>
													{foreach $level_category_extend as $v}
													<optgroup label="{$v.name}">
														{foreach $v['level_list'] as $level}
														<option value="{$level.id}" {if $level['id'] == $levelExtend['levelid']}selected{/if}>{$level.name}</option>
														{/foreach}
													</optgroup>
													{/foreach}
												</select>
											</div>
											<div>
												<div class="layui-form-mid">有效期</div>
												<div class="layui-input-inline" id="level_extend_endtime_div" style="{if $info['level_extend_endtime']==0}display:none{/if}">
													<input type="text" name="record[levelendtime]" id="level_extend_endtime" autocomplete="off" class="layui-input" value="{$levelExtend['levelendtime'] > 0 ? date('Y-m-d',$levelExtend['levelendtime']) : ''}">
												</div>
												<div class="layui-input-inline">
													<input type="checkbox" name="level_extend_cq" value="1" {if $levelExtend['levelendtime']==0}checked{/if} title="长期" lay-filter="level_extend_cq"/>
												</div>
											</div>
										</div>
										<div class="layui-form-item">
											<label class="layui-form-label">区域代理</label>
											<div class="layui-input-inline" style="width:700px">
												<input type="radio" name="record[areafenhong]" value="0" lay-filter="areafenhongChange" {if $levelExtend['areafenhong']==0}checked{/if} title="跟随会员等级设置"/>
												<input type="radio" name="record[areafenhong]" value="1" lay-filter="areafenhongChange" {if $levelExtend['areafenhong']==1}checked{/if} title="省级代理"/>
												<input type="radio" name="record[areafenhong]" value="2" lay-filter="areafenhongChange" {if $levelExtend['areafenhong']==2}checked{/if} title="市级代理"/>
												<input type="radio" name="record[areafenhong]" value="3" lay-filter="areafenhongChange" {if $levelExtend['areafenhong']==3}checked{/if} title="区县代理"/>
												<input type="radio" name="record[areafenhong]" value="4" lay-filter="areafenhongChange" {if $levelExtend['areafenhong']==4}checked{/if} title="非区域代理"/>
											</div>
										</div>
										<div class="layui-form-item areafenhong_address" {if ($levelExtend['areafenhong']==0 && $levelArr[$levelExtend['levelid']]['areafenhong']==0) || $levelExtend['areafenhong']==4}style="display:none"{/if}>
											<label class="layui-form-label">代理区域</label>
											<div class="layui-input-inline">
												<select name="record[areafenhong_province]" id="areafenhong_province_{$levelExtend.id}" lay-filter="areafenhong_province_{$levelExtend.id}"></select>
											</div>
											<div class="layui-input-inline areafenhong_city_div" {if ($levelExtend['areafenhong']==0 && !in_array($levelArr[$levelExtend['levelid']]['areafenhong'],[2,3])) || $levelExtend['areafenhong']==1}style="display:none"{/if}>
												<select name="record[areafenhong_city]" id="areafenhong_city_{$levelExtend.id}" lay-filter="areafenhong_city_{$levelExtend.id}"></select>
											</div>
											<div class="layui-input-inline areafenhong_area_div" {if ($levelExtend['areafenhong']==0 && $levelArr[$levelExtend['levelid']]['areafenhong']!=3) || in_array($levelExtend['areafenhong'],[1,2])}style="display:none"{/if}>
												<select name="record[areafenhong_area]" id="areafenhong_area_{$levelExtend.id}"></select>
											</div>
										</div>
										<div class="layui-form-item areafenhong_bili" {if !in_array($levelExtend['areafenhong'],[1,2,3])}style="display:none"{/if}>
											<label class="layui-form-label">分红比例</label>
											<div class="layui-input-inline">
												<input type="text" name="record[areafenhongbl]" class="layui-input" value="{$levelExtend.areafenhongbl}">
											</div>
											<div class="layui-form-mid">%</div>
											<div class="layui-form-mid layui-word-aux">区域代理的分红比例</div>
										</div>
									</div>
									<input type="hidden" name="record[id]" value="{$levelExtend['id']}" >

									{/foreach}
									{else}
									<div class="level-box">
										<div class="layui-form-item">
											<label class="layui-form-label">扩展等级</label>
											<div class="layui-input-inline">
												<select name="record[levelid]" lay-verify="required">
													<option value="0">请选择</option>
													{foreach $level_category_extend as $v}
													<optgroup label="{$v.name}">
														{foreach $v['level_list'] as $level}
														<option value="{$level.id}" {if $level['id'] == $levelExtend['id']}selected{/if}>{$level.name}</option>
														{/foreach}
													</optgroup>
													{/foreach}
												</select>
											</div>
											<div>
												<div class="layui-form-mid">有效期</div>
												<div class="layui-input-inline" id="level_extend_endtime_div" style="{if $info['level_extend_endtime']==0}display:none{/if}">
													<input type="text" name="record[levelendtime]" id="level_extend_endtime" autocomplete="off" class="layui-input" value="{$levelExtend['levelendtime'] > 0 ? date('Y-m-d',$levelExtend['levelendtime']) : ''}">
												</div>
												<div class="layui-input-inline">
													<input type="checkbox" name="record[level_extend_cq]" value="1" {if $levelExtend['levelendtime']==0}checked{/if} title="长期" lay-filter="level_extend_cq"/>
												</div>
											</div>
										</div>
										<div class="layui-form-item">
											<label class="layui-form-label">区域代理</label>
											<div class="layui-input-inline" style="width:700px">
												<input type="radio" name="record[areafenhong]" value="0" lay-filter="areafenhongChange" {if $record['areafenhong']==0}checked{/if} title="跟随会员等级设置"/>
												<input type="radio" name="record[areafenhong]" value="1" lay-filter="areafenhongChange" {if $record['areafenhong']==1}checked{/if} title="省级代理"/>
												<input type="radio" name="record[areafenhong]" value="2" lay-filter="areafenhongChange" {if $record['areafenhong']==2}checked{/if} title="市级代理"/>
												<input type="radio" name="record[areafenhong]" value="3" lay-filter="areafenhongChange" {if $record['areafenhong']==3}checked{/if} title="区县代理"/>
												<input type="radio" name="record[areafenhong]" value="4" lay-filter="areafenhongChange" {if $record['areafenhong']==4}checked{/if} title="非区域代理"/>
											</div>
										</div>
										<div class="layui-form-item areafenhong_address" style="display:none">
											<label class="layui-form-label">代理区域</label>
											<div class="layui-input-inline">
												<select name="record[areafenhong_province]" id="areafenhong_province_0" lay-filter="areafenhong_province_0"></select>
											</div>
											<div class="layui-input-inline areafenhong_city_div"style="display:none">
												<select name="record[areafenhong_city]" id="areafenhong_city_0" lay-filter="areafenhong_city_0"></select>
											</div>
											<div class="layui-input-inline areafenhong_area_div" style="display:none">
														<select name="record[areafenhong_area]" id="areafenhong_area_0"></select>
											</div>
										</div>
										<div class="layui-form-item areafenhong_bili" style="display:none">
											<label class="layui-form-label">分红比例</label>
											<div class="layui-input-inline">
												<input type="text" name="record[areafenhongbl]" class="layui-input" value="0">
											</div>
											<div class="layui-form-mid">%</div>
											<div class="layui-form-mid layui-word-aux">区域代理的分红比例</div>
										</div>
									</div>

									{/if}
									{/if}

									<div class="layui-form-item">
										<label class="layui-form-label">推荐人ID</label>
										<div class="layui-input-inline">
											<input type="text" name="info[pid]" class="layui-input" value="{$info.pid}">
										</div>
										<div class="layui-form-mid layui-word-aux">无推荐人请填写0</div>
									</div>
					
									{if getcustom('member_tag')}
									<div class="layui-form-item">
										<label class="layui-form-label">标签设置：</label>
										<div class="layui-input-inline" style="width:500px">
											{foreach $tagsdata as $v}
											<input type="checkbox" name="info[tags][]" value="{$v.id}" title="{$v.name}" {if in_array($v['id'],$info['tags'])}checked{/if}/>
											{/foreach}
										</div>
									</div>
									{/if}	

									{if $info['tel']  || !$info['id']}
									<div class="layui-form-item">
										<label class="layui-form-label">登录密码</label>
										<div class="layui-input-inline">
											<input type="text" name="info[pwd]" autocomplete="off" class="layui-input" value="" placeholder="留空表示不修改密码">
										</div>
									</div>
									{/if}
									<div class="layui-form-item">
										<label class="layui-form-label">支付密码</label>
										<div class="layui-input-inline">
											<input type="text" name="info[paypwd]" autocomplete="off" class="layui-input" value="" placeholder="留空表示不修改支付密码">
										</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">备注</label>
										<div class="layui-input-inline">
											<input type="text" name="info[remark]" class="layui-input" value="{$info['remark']}">
										</div>
									</div>
									{if getcustom('fenhong_max')}
									<div class="layui-form-item">
										<label class="layui-form-label">股东分红上限</label>
										<div class="layui-input-inline">
											<input type="text" name="info[fenhong_max]" class="layui-input" value="{$info['fenhong_max']}">
										</div>
									</div>
									{/if}
									{if getcustom('member_levelup_auth') && $haverechargeAuth}
									<div class="layui-form-item">
										<label class="layui-form-label">赠送/售卖额度</label>
										<div class="layui-input-inline">
											<input type="text" name="info[salelevel_money]" class="layui-input" value="{$info['salelevel_money']}">
										</div>
									</div>
									{/if}

									{if getcustom('plug_luckycollage')}
									<div class="layui-form-item">
										<label class="layui-form-label">开团次数</label>
										<div class="layui-input-inline">
											<input type="text" name="info[ktnum]" class="layui-input" value="{$info['ktnum']}">
										</div>
									</div>
									{/if}

									{if getcustom('plug_businessqr')}
									<div class="layui-form-item">
										<label class="layui-form-label">绑定的店铺</label>
										<div class="layui-input-inline">
											<select name="info[bid]" lay-verify="required" lay-filter="yxqset">
												<option value="0">无</option>
												{foreach $blist as $v}
												<option value="{$v.id}" {if $v['id'] == $info['bid']}selected{/if}>{$v.name}</option>
												{/foreach}
											</select>
										</div>
									</div>
									{/if}
									{if getcustom('business_fenxiao')}
									<div class="layui-form-item">
										<label class="layui-form-label">冻结提现功能</label>
										<div class="layui-input-inline" style="width:700px">
											<input type="radio" name="info[disable_withdraw]" value="0" {if $info['disable_withdraw']==0}checked{/if} title="否"/>
											<input type="radio" name="info[disable_withdraw]" value="1" {if $info['disable_withdraw']==1}checked{/if} title="是"/>
										</div>
									</div>
									{/if}
								</div>
								<!--基本信息End-->
								<!--自定义信息start-->
 								{if getcustom('register_fields')}
  							<input type="hidden" name="formdata[id]" value="{$register_record.id}">
  							<div class="layui-tab-item">
									{volist name="register_record.content" id="item" key="key"}
									{php}
										$formkey = 'form'.($key-1);
										$val = $register_record['form'.($key-1)]??'';
									{/php}
									{if $item.key=='input'}
									<div class="layui-form-item">
										<label class="layui-form-label">{$item.val1}</label>
										<div class="layui-input-inline">
											<input type="text" name="formdata[{$formkey}]" class="layui-input" value="{$val}">
										</div>
									</div>
									{/if}
									{if $item.key=='textarea'}
									<div class="layui-form-item">
										<label class="layui-form-label">{$item.val1}</label>
										<div class="layui-input-inline" style="min-width: 300px">
											<textarea class="layui-textarea" name="formdata[{$formkey}]">{$val}</textarea>
										</div>
									</div>
									{/if}
									{if $item.key=='seletor'}
									<div class="layui-form-item">
										<label class="layui-form-label">{$item.val1}</label>
										<div class="layui-input-inline">
											<select name="formdata[{$formkey}]" class="layui-select">
												<option name="">请选择</option>
												{volist name="item.val2" id="item2"}
												<option name="">{$item2}</option>
												{/volist}
											</select>
										</div>
									</div>
									{/if}
									{if $item.key=='radio'}
									<div class="layui-form-item">
										<label class="layui-form-label">{$item.val1}</label>
										<div class="layui-input-inline">
											{volist name="item.val2" id="item2"}
												<label><input type="radio" name="formdata[{$formkey}]" title="{$item2}" value="{$item2}" {if $item2==$val}checked{/if}></label>
											{/volist}
										</div>
									</div>
									{/if}
									{if $item.key=='checkbox'}
									{php}
									$val = explode(',',$val);
									{/php}
									<div class="layui-form-item">
										<label class="layui-form-label">{$item.val1}</label>
										<div class="layui-input-inline" style="min-width: 40%">
											{volist name="item.val2" id="item2"}
											<input type="checkbox" name="formdata[{$formkey}][]" value="{$item2}" title="{$item2}" {if in_array($item2,$val)}checked{/if}>
											{/volist}
										</div>
									</div>
									{/if}
									{if $item.key=='seletor'}
									<div class="layui-form-item">
										<label class="layui-form-label">{$item.val1}</label>
										<div class="layui-input-inline">
											<select name="formdata[{$formkey}]" class="layui-select">
												<option name="">请选择</option>
												{volist name="item.val2" id="item2"}
												<option name="formdata[{$formkey}]" {if $item2==$val}selected{/if}>{$item2}</option>
												{/volist}
											</select>
										</div>
									</div>
									{/if}
									{if $item.key=='time'}
									<div class="layui-form-item">
										<label class="layui-form-label">{$item.val1}</label>
										<div class="layui-input-inline">
											<input type="text" name="formdata[{$formkey}]" id="{$formkey}" class="layui-input timeinput" value="{$val}">
										</div>
									</div>
									{/if}
									{if $item.key=='date'}
									<div class="layui-form-item">
										<label class="layui-form-label">{$item.val1}</label>
										<div class="layui-input-inline">
											<input type="text" name="formdata[{$formkey}]" id="{$formkey}" class="layui-input dateinput" value="{$val}">
										</div>
									</div>
									{/if}
									{if $item.key=='upload'}
									<div class="layui-form-item">
										<label class="layui-form-label">{$item.val1}</label>
										<div class="layui-input-inline" style="min-width: 40%">
											<input type="hidden" name="formdata[{$formkey}]" id="formpic{$formkey}" class="layui-input" value="{$val}">
											<button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="formpic{$formkey}" upload-preview="formpic{$formkey}Preview" onclick="uploader(this)">上传图片</button>
											<div id="formpic{$formkey}Preview" style="float:left;padding-top:10px;clear: both;">
												<div class="layui-imgbox" style="width:100px;"><div class="layui-imgbox-img"><img src="{$val}"/></div></div>
											</div>
										</div>
									</div>
									{/if}
									{if $item.key=='region'}
									<div class="layui-form-item region_item" id="region{$customeKey}" data-text="{$val}">
										<label class="layui-form-label" >{$item.val1}：</label>
										<div class="layui-input-inline custom_province_div" style="width: 150px">
											<select name="formdata[{$formkey}][]" id="region{$customeKey}_province" lay-filter="region{$customeKey}_province"></select>
										</div>
										<div class="layui-input-inline custom_city_div" style="width: 150px">
											<select name="formdata[{$formkey}][]" id="region{$customeKey}_city" lay-filter="region{$customeKey}_area"></select>
										</div>
										<div class="layui-input-inline custom_area_div" style="width: 150px" style="display:none">
											<!--							<select name="custom[form{$customeKey}][]" id="region{$customeKey}_area"></select>-->
											<select name="formdata[{$formkey}][]" id="region{$customeKey}_area"></select>
										</div>
									</div>
									{/if}
									{/volist}
								</div>
								{/if}
								<!--自定义信息end-->
								{if getcustom('member_set')}
								<div class="layui-tab-item">
									{if $setcontent}
										{foreach $setcontent as $k=>$field}
										<div class="layui-form-item">
											{if $field.key=='separate'}
											<label class="layui-form-label" style="font-size: 16px;font-weight: bold">{$field.val1}</label>
											{else/}
											<label class="layui-form-label">{if $field['val3']==1}<span class="redstar">*</span>{/if}{$field.val1}：</label>
											{/if}
											{if $field['key'] == 'input'}
											<div class="layui-input-inline">
												<input type="text" name="set[form{$k}]" value="{$log['form'.$k]}" class="layui-input">
											</div>
											{/if}
											{if $field['key'] == 'textarea'}
											<div class="layui-input-inline">
												<textarea type="text" name="set[form{$k}]" class="layui-textarea">{$log['form'.$k]}</textarea>
											</div>
											{/if}
											{if $field['key'] == 'radio'}
											<div class="layui-input-inline" style="width:500px">
												{foreach $field['val2'] as $k2=>$v2}
												<input type="radio" name="set[form{$k}]" value="{$v2}" title="{$v2}" {if $log['form'.$k] && $log['form'.$k] == $v2}checked{/if} />
												{/foreach}
											</div>
											{/if}
											{if $field['key'] == 'checkbox'}
											<div class="layui-input-inline" style="width:500px">
												{foreach $field['val2'] as $k2=>$v2}
												<input type="checkbox" name="set[form{$k}]" value="{$v2}" title="{$v2}" {if $log['form'.$k] && in_array($v2,explode(',',$log['form'.$k]))}checked{/if} />
												{/foreach}
											</div>
											{/if}
											{if $field['key'] == 'selector'}
											<div class="layui-input-inline">
												<select name="set[form{$k}]">
													<option value="">请选择</option>
													{foreach $field['val2'] as $k2=>$v2}
													<option value="{$v2}" {if $log['form'.$k] && $log['form'.$k] == $v2}selected{/if}>{$v2}</option>
													{/foreach}
												</select>
											</div>
											{/if}
											{if $field['key'] == 'time'}
											<div class="layui-input-inline">
												<input type="text" name="set[form{$k}]" value="{$log['form'.$k]}" class="layui-input" id="set{$k}"/>
											</div>
											{/if}
											{if $field['key'] == 'date'}
											<div class="layui-input-inline">
												<input type="text" name="set[form{$k}]" value="{$log['form'.$k]}" class="layui-input" id="set{$k}"/>
											</div>
											{/if}
											{if $field['key'] == 'region'}
											<div class="layui-input-inline">
												<select name="set[form{$k}][]" id="set{$k}_province" lay-filter="set{$k}_province"></select>
											</div>
											<div class="layui-input-inline">
												<select name="set[form{$k}][]" id="set{$k}_city" lay-filter="set{$k}_city"></select>
											</div>
											<div class="layui-input-inline">
												<select name="set[form{$k}][]" id="set{$k}_area" ></select>
											</div>
											{/if}
											{if $field['key'] == 'upload'}
											<input type="hidden" name="set[form{$k}]" id="form{$k}" class="layui-input" value="{$log['form'.$k]}">
											<button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="form{$k}" upload-preview="form{$k}Preview" onclick="uploader(this)">上传图片</button>
											<div id="form{$k}Preview" class="picsList-class-padding">
												<div class="layui-imgbox" style="width:100px;"><div class="layui-imgbox-img"><img src="{$log['form'.$k]}"/></div></div>
											</div>
											{/if}
											{if $field['key'] == 'upload_file'}
											<div class="layui-input-inline">
												<input type="text" name="set[form{$k}]" value="{$log['form'.$k]}" class="layui-input" id="set{$k}"/>
											</div>
											{/if}
										</div>
									{/foreach}
									{/if}
								</div>
								{/if}

								{if getcustom('member_richinfo')}
								<div class="layui-tab-item">
									<!-- 详情编辑器 -->
									<?php 
									$pagetitle='详细介绍';
									$pagedata= $info['richinfo'] && json_decode($info['richinfo']) ? $info['richinfo'] : '[{"id":"M0000000000000","temp":"richtext","params":{bgcolor:"#FFFFFF",margin_x:"0",margin_y:"5",padding_x:"10",padding_y:"10","quanxian":{"all":true},"platform":{"all":true}},"data":"","other":"","content":""}]';
									?>
									{include file="designer_page/designer_editor" /}
								</div>
								{/if}
								<div class="layui-form-item">
									<label class="layui-form-label"></label>
									<div class="layui-input-block">
										{if $info['id']}
										<button class="layui-btn" lay-submit lay-filter="member_edit">确认修改</button>
										{else /}
										<button class="layui-btn" lay-submit lay-filter="member_edit">保存</button>
										{/if}
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
</div>
  {if !getcustom('member_richinfo')}
	{include file="public/js"/}
	{/if}
	<script>
	//日期范围选择
	layui.laydate.render({
		elem: '#birthday',
		trigger: 'click',
		range: false //或 range: '~' 来自定义分割字符
	});	
	{if getcustom('member_area_agent_multi')}
	var dataList = $.extend(true,provinceList,dataList);
	dataList.splice(0,1);
	var areaAlert = true,
		provinceIndex = 0,
		cityIndex = 0,
		dataInfo = {$area_agent_info},
		indexInfo = [];

	function setIndex(){
		for(let i=0;i<dataInfo.length;i++){
			if(tagCount(dataInfo[i]).toString()=='0'){
				for(let j=0;j<dataList.length;j++){
					if(dataInfo[i]==dataList[j].name){
						let item = {
							'provinceIndex': j.toString()
						}
						indexInfo.push(item)
					}
				}
			}else if(tagCount(dataInfo[i]).toString()=='1'){
				let front = getAfter(dataInfo[i],0);
				let after = getAfter(dataInfo[i],1);
				let item = {
						'provinceIndex': '',
						'cityIndex': ''
					}
				for(let j=0;j<dataList.length;j++){
					if(front==dataList[j].name){
						item.provinceIndex = j.toString()
					}
				}
				for(let k=0;k<dataList[item.provinceIndex].cityList.length;k++){
					if(after==dataList[item.provinceIndex].cityList[k].name){
						item.cityIndex = k.toString()
					}
				}
				indexInfo.push(item)
			}else if(tagCount(dataInfo[i]).toString()=='2'){
				let front = getFront(dataInfo[i],0);
				let center = getCenter(dataInfo[i]);
				let after = getAfter(dataInfo[i],1);
				let item = {
						'provinceIndex': '',
						'cityIndex': '',
						'areaIndex': ''
					}
				for(let j=0;j<dataList.length;j++){
					if(front==dataList[j].name){
						item.provinceIndex = j.toString()
					}
				}
				for(let k=0;k<dataList[item.provinceIndex].cityList.length;k++){
					if(center==dataList[item.provinceIndex].cityList[k].name){
						item.cityIndex = k.toString()
					}
				}
				for(let l=0;l<dataList[item.provinceIndex].cityList[item.cityIndex].areaList.length;l++){
					if(after==dataList[item.provinceIndex].cityList[item.cityIndex].areaList[l]){
						item.areaIndex = l.toString()
					}
				}
				indexInfo.push(item);
			}
		}
	}
	setIndex();
	function getFront(obj,state){
		var index=obj.indexOf("\-");
		if(state==0){
			obj=obj.substring(0,index);
		}else {
			obj=obj.substring(index+1,obj.length);
		}
		return obj;
	}
	function getCenter(obj){
		var str = obj;
		str = str.match(/-(\S*)-/)[1];
		return str;
	}
	function getAfter(obj,state) {
		var index=obj.lastIndexOf("\-");
		if(state==0){
			obj=obj.substring(0,index);
		}else {
			obj=obj.substring(index+1,obj.length);
		}
		return obj;
	}
	function tagCount(obj){
		let str = obj;
		let array = str.match(/-/g);
		let count = array ? array.length: 0;
		return count;
	}
	function createProvince(){
		$(".select_province").empty();
		for(let i=0;i<dataList.length;i++){
			$(".select_province").append("<div class='alert_item' index='"+ i +"'><div class='alert_icon province_select'><i class='layui-icon layui-icon-ok' style='font-size: 12px; color: #fff;font-weight: bold;'></i></div><div class='alert_text province_more'>"+ dataList[i].name +"</div><i class='layui-icon layui-icon-triangle-r province_more'></i></div>")
		}
		for(let i=0;i<dataList.length;i++){
			for(let j=0;j<indexInfo.length;j++){
				if(i == indexInfo[j].provinceIndex){
					$(".province_select").eq(indexInfo[j].provinceIndex).addClass('alert_active');
				}
			}
		}
	}
	function createCity(){
		$(".select_city").empty();
		for(let i=0;i<dataList[provinceIndex].cityList.length;i++){
			$(".select_city").append("<div class='alert_item' index='"+ i +"'><div class='alert_icon city_select'><i class='layui-icon layui-icon-ok' style='font-size: 12px; color: #fff;font-weight: bold;'></i></div><div class='alert_text city_more'>"+ dataList[provinceIndex].cityList[i].name +"</div><i class='layui-icon layui-icon-triangle-r city_more'></i></div>")
		}
		for(let i=0;i<dataList[provinceIndex].cityList.length;i++){
        	for(let j=0;j<indexInfo.length;j++){
				if(provinceIndex == indexInfo[j].provinceIndex){
					if(i == indexInfo[j].cityIndex){
						$(".city_select").eq(indexInfo[j].cityIndex).addClass('alert_active');
					}
				}
			}
		}
	}
	function createArea(){
		$(".select_area").empty();
		for(let i=0;i<dataList[provinceIndex].cityList[cityIndex].areaList.length;i++){
			$(".select_area").append("<div class='alert_item' index='"+ i +"'><div class='alert_icon area_select'><i class='layui-icon layui-icon-ok' style='font-size: 12px; color: #fff;font-weight: bold;'></i></div><div class='alert_text'>"+ dataList[provinceIndex].cityList[cityIndex].areaList[i] +"</div></div>")
		}
		for(let i=0;i<dataList[provinceIndex].cityList[cityIndex].areaList.length;i++){
        	for(let j=0;j<indexInfo.length;j++){
				if(provinceIndex == indexInfo[j].provinceIndex){
					if(cityIndex == indexInfo[j].cityIndex){
						if(i == indexInfo[j].areaIndex){
							$(".area_select").eq(indexInfo[j].areaIndex).addClass('alert_active');
						}
					}
				}
			}
		}
	}
	function createTag(){
		$(".area_content").empty();
		if(dataInfo.length){
			for(let i=0;i<dataInfo.length;i++){
				$(".area_content").append("<div class='area_item'>"+ dataInfo[i] +"<i style='font-weight:bold;margin-left:5px;font-size:14px' index='"+ i +"' class='layui-icon layui-icon-close area_cut'></i></div>")
			}
		}else{
			$(".area_content").html("请选择代理区域");
		}
	}
	createTag();
	function setOpt(){
		$(document).on('click',".province_select",function(){
			let item_name = dataList[$(this).parent().attr('index')].name;
			let item_index = $(this).parent().attr('index');
			let index = '';
			for(let i=0;i<indexInfo.length;i++){
				if(indexInfo[i].provinceIndex==item_index){
					if(indexInfo[i].cityIndex){
						return;
					}
					index = i;
				}
			}
			if(index.toString()==''){
				dataInfo.push(item_name);
				indexInfo.push(
					{
						'provinceIndex': item_index.toString()
					}
				);
				$(this).addClass('alert_active');
			}else{
				dataInfo.splice(index,1);
				indexInfo.splice(index,1);
				$(this).removeClass('alert_active');
			}
			createTag();
		})
		$(document).on('click',".city_select",function(){
			let item_name = dataList[provinceIndex].name + '-' + dataList[provinceIndex].cityList[$(this).parent().attr('index')].name;
			let item_index = $(this).parent().attr('index');
			let index = '';
			let indexO = 'none';
			for(let i=0;i<indexInfo.length;i++){
				if(indexInfo[i].provinceIndex==provinceIndex){
					if(indexInfo[i].cityIndex){
						if(indexInfo[i].cityIndex == item_index){
							index = i;
							indexO = 'have';
						}
					}else{
						index = i;
						indexO = 'cover';
					}
				}
			}
			if(indexO=='none'){
				dataInfo.push(item_name);
				indexInfo.push(
					{
						'provinceIndex': provinceIndex.toString(),
						'cityIndex': item_index.toString()
					}
				);
				$(".province_select").eq(provinceIndex).addClass('alert_active');
				$(this).addClass('alert_active');
			}else if(indexO=='have'){
				if(indexInfo[index].areaIndex){
					return;
				}
				dataInfo.splice(index,1);
				indexInfo.splice(index,1);
				let currentAry = [];
				for(let i=0;i<indexInfo.length;i++){
					if(indexInfo[i].provinceIndex==provinceIndex){
						currentAry.push(i);
					}
				}
				if(!currentAry.length){
					$(".province_select").eq(provinceIndex).removeClass('alert_active');
				}
				$(this).removeClass('alert_active');
			}else if(indexO=='cover'){
				dataInfo[index] = item_name;
				indexInfo[index] = {
					'provinceIndex': provinceIndex.toString(),
					'cityIndex': item_index.toString()
				};
				$(".province_select").eq(provinceIndex).addClass('alert_active');
				$(this).addClass('alert_active');
			}
			createTag();
		})
		$(document).on('click',".area_select",function(){
			let item_name = dataList[provinceIndex].name + '-' + dataList[provinceIndex].cityList[cityIndex].name + '-' + dataList[provinceIndex].cityList[cityIndex].areaList[$(this).parent().attr('index')];
			let item_index = $(this).parent().attr('index');
			let index = '';
			let indexO = 'none';
			for(let i=0;i<indexInfo.length;i++){
				if(indexInfo[i].provinceIndex==provinceIndex){
					if(indexInfo[i].cityIndex){
						if(indexInfo[i].cityIndex == cityIndex){
							if(indexInfo[i].areaIndex){
								if(indexInfo[i].areaIndex == item_index){
									index = i;
									indexO = 'have';
								}
							}else{
								index = i;
								indexO = 'cover';
							}
						}
					}else{
						index = i;
						indexO = 'cover';
					}
				}
			}
			if(indexO=='none'){
				dataInfo.push(item_name);
				indexInfo.push(
					{
						'provinceIndex': provinceIndex.toString(),
						'cityIndex': cityIndex.toString(),
						'areaIndex': item_index.toString()
					}
				);
				$(".province_select").eq(provinceIndex).addClass('alert_active');
				$(".city_select").eq(cityIndex).addClass('alert_active');
				$(this).addClass('alert_active');
			}else if(indexO=='have'){
				dataInfo.splice(index,1);
				indexInfo.splice(index,1);
				let pAry = [];
				let cAry = [];
				for(let i=0;i<indexInfo.length;i++){
					if(indexInfo[i].provinceIndex==provinceIndex){
						pAry.push(i);
						if(indexInfo[i].cityIndex==cityIndex){
							cAry.push(i);
						}
					}
				}
				if(!pAry.length){
					$(".province_select").eq(provinceIndex).removeClass('alert_active');
				}
				if(!cAry.length){
					$(".city_select").eq(cityIndex).removeClass('alert_active');
				}
				$(this).removeClass('alert_active');
			}else if(indexO=='cover'){
				dataInfo[index] = item_name;
				indexInfo[index] = {
					'provinceIndex': provinceIndex.toString(),
					'cityIndex': cityIndex.toString(),
					'areaIndex': item_index.toString()
				};
				$(".province_select").eq(provinceIndex).addClass('alert_active');
				$(".city_select").eq(cityIndex).addClass('alert_active');
				$(this).addClass('alert_active');
			}
			createTag();
		})
		$(document).on('click',".province_more",function(){
			provinceIndex = $(this).parent().attr('index');
			cityIndex = 0;
			createCity();
			createArea();
		})
		$(document).on('click',".city_more",function(){
			cityIndex = $(this).parent().attr('index');
			createArea();
		})
	}
	setOpt();
	$(document).on('click',".area_cut",function(event){
		let index = $(this).attr('index');
		dataInfo.splice(index,1);
		indexInfo.splice(index,1);
		createTag();
		event.stopPropagation();
	})
	$(document).on('click',".area_module",function(){
		createProvince();
		createCity();
		createArea();
		$(".alert").show();
	})
	$(document).on('click',".alert_hide",function(){
		createProvince();
		createCity();
		createArea();
		$(".alert").hide();
	})
	{/if}

	var levelArr = {:jsonEncode($levelArr)};
	var defaultlevelid = "{$defaultlevel['id']}";
	layui.form.on('checkbox(levelcq)', function(data){
		if(data.elem.checked){
			$('#levelendtime_div').hide();
		}else{
			$('#levelendtime_div').show();
		}
	});
	layui.form.on('checkbox(level_extend_cq)', function(data){
		if(data.elem.checked){
			$('#level_extend_endtime_div').hide();
		}else{
			$('#level_extend_endtime_div').show();
		}
	});
	layui.form.on('select(yxqset)', function(data){
		var levelid = data.value
		if(levelid != defaultlevelid){
			$('#yxqset').show();
		}else{
			$('#yxqset').hide();
		}
		setareafenhong();
	});
	layui.form.on('radio(areafenhongChange)',function(data){
		setareafenhong(this);
	});
	function setareafenhong(e){
		var formdata = layui.form.val('form');
		var areafenhong = $(e).val();
		var levelid = $(e).parents('.level-box').find('.levelid').val();
		var parent = $(e).parents('.level-box');
		if((areafenhong==0 && levelArr[levelid].areafenhong != 0) || areafenhong==1 || areafenhong==2 || areafenhong==3 || areafenhong==10){
			parent.find('.areafenhong_address').show();
			parent.find('.areafenhong_largearea_div').hide();
			parent.find('.areafenhong_province_div').hide();
			parent.find('.areafenhong_city_div').hide();
			parent.find('.areafenhong_area_div').hide();
			if((areafenhong==0 && levelArr[levelid].areafenhong == 10) || areafenhong==10){
				parent.find('.areafenhong_largearea_div').show();
			}
			if((areafenhong==0 && levelArr[levelid].areafenhong == 1) || areafenhong==1){
				parent.find('.areafenhong_province_div').show();
			}
			if((areafenhong==0 && levelArr[levelid].areafenhong == 2) || areafenhong==2){
				parent.find('.areafenhong_province_div').show();
				parent.find('.areafenhong_city_div').show();
			}
			if((areafenhong==0 && levelArr[levelid].areafenhong == 3) || areafenhong == 3){
				parent.find('.areafenhong_province_div').show();
				parent.find('.areafenhong_city_div').show();
				parent.find('.areafenhong_area_div').show();
			}
		}else{
			parent.find('.areafenhong_address').hide();
		}
		if(areafenhong==0 || areafenhong==4){
			parent.find('.areafenhong_bili').hide();
		}else{
			parent.find('.areafenhong_bili').show();
		}
	}
	//日期范围选择
	layui.laydate.render({
		elem: '#levelendtime',
		trigger: 'click'
	});
	//日期范围选择
	layui.laydate.render({
		elem: '#level_extend_endtime',
		trigger: 'click'
	});
	//所有的时间控件
	$('.timeinput').each(function (e){
		var objId = $(this).attr('id');
		layui.laydate.render({
			elem: "#"+objId,
			type: 'time'
		})
	})
	//所有的日期控件
	$('.dateinput').each(function (e){
		var objId = $(this).attr('id');
		layui.laydate.render({
			elem: "#"+objId,
			type: 'date'
		})
	})


	address3('areafenhong_province','areafenhong_city','areafenhong_area',"{$info.areafenhong_province}","{$info.areafenhong_city}","{$info.areafenhong_area}");
	{if getcustom('plug_sanyang')}
	{if !$levelExtendList}
	address3('areafenhong_province_0','areafenhong_city_0','areafenhong_area_0',"","","");
	{/if}
	{foreach $levelExtendList as $levelExtend}
	address3('areafenhong_province_{$levelExtend.id}','areafenhong_city_{$levelExtend.id}','areafenhong_area_{$levelExtend.id}',"{$levelExtend.areafenhong_province}","{$levelExtend.areafenhong_city}","{$levelExtend.areafenhong_area}");
	{/foreach}
	{/if}

	{if !$register_record}
		$('.region_item').each(function (index,obj){
			var regionId = $(obj).attr('id');
			var areatext = $(obj).data('text');
			var provinceId = regionId+'_province';
			var cityId = regionId+'_city';
			var areaId = regionId+'_area';
			var provinceVal = '';
			var cityVal = '';
			var areaVal = '';
			if(areatext){
				var areaAry = areatext.split(',');
				if(areaAry.length>0){
					provinceVal = areaAry[0];
				}
				if(areaAry.length>1){
					cityVal = areaAry[1];
				}
				if(areaAry.length>2){
					areaVal = areaAry[2];
				}
			}
			address3(provinceId,cityId,areaId,provinceVal,cityVal,areaVal);
		})
	{/if}

	var upload = layui.upload;
  //执行实例
  var uploadInst = upload.render({
    elem: '#headimgupload' //绑定元素
    ,url: "{:url('upload/index')}" //上传接口
    ,done: function(res){
			$('#headimg').val(res.data)
			$('#headimgPreview').attr('src',res.data);
      //上传完毕回调
    }
    ,error: function(){
      //请求异常回调
    }
  });
  {if getcustom('member_set')}
  	{foreach $setcontent as $k=>$field}
		{if $field['key'] == 'time'}
			layui.laydate.render({ 
				elem: '#set{$k}'
				,type: 'time'
				,format:'HH:mm'
				,range: false,
				trigger: 'click'
			});
		{/if}
		{if $field['key'] == 'date'}
			layui.laydate.render({ 
				elem: '#set{$k}'
				,type: 'date'
				,range: false,
				trigger: 'click'
			});
		{/if}
		{if $field['key'] == 'region'}
			{php}
				$setdata = $log['form'.$k] ? explode(',',$log['form'.$k]) : [];
			{/php}
			address3('set{$k}_province','set{$k}_city','set{$k}_area',"{$setdata[0]}","{$setdata[1]}","{$setdata[2]}");
		{/if}
	{/foreach}
  {/if}
	layui.form.on('submit(member_edit)', function(obj){
		console.log('submit(member_edit)')
		var field = obj.field
		if(!field['levelcq']) field['levelcq'] = 0
		{if getcustom('member_area_agent_multi')}field.areadata = dataInfo;{/if}
		{if getcustom('member_richinfo')}field['info[richinfo]'] = geteditordata();{/if}
		var index = layer.load();
		$.post("{:url('save')}",obj.field,function(data){
			layer.close(index);
			dialog(data.msg,data.status);
			if(data.status == 1){
				setTimeout(function(){
					parent.layer.closeAll();
					parent.tableIns.reload()
				},1000)
			}
		})
	})
  </script>
	{include file="public/copyright"/}
</body>
</html>